home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Workbench Add-On
/
Workbench Add-On - Volume 1.iso
/
Dev
/
Oberon
/
source
/
amiga
/
InputEvent.mod
< prev
next >
Wrap
Text File
|
1995-06-29
|
10KB
|
290 lines
(**************************************************************************
$RCSfile: InputEvent.mod $
Description: input event definitions
Created by: fjc (Frank Copeland)
$Revision: 3.8 $
$Author: fjc $
$Date: 1995/06/04 23:13:14 $
$VER: inputevent.h 36.10 (26.6.92)
Includes Release 40.15
(C) Copyright 1985-1993 Commodore-Amiga, Inc.
All Rights Reserved
Oberon-A interface Copyright © 1994-1995, Frank Copeland.
This file is part of the Oberon-A Interface.
See Oberon-A.doc for conditions of use and distribution.
***************************************************************************)
<* STANDARD- *>
MODULE [2] InputEvent;
IMPORT e := Exec, u := Utility, t := Timer, g := Graphics, s := Sets;
(* ----- constants --------------------------------------------------*)
CONST
(* --- InputEvent.ieClass --- *)
(* A NOP input event *)
null * = 00H;
(* A raw keycode from the keyboard device *)
rawkey * = 01H;
(* The raw mouse report from the game port device *)
rawmouse * = 02H;
(* A private console event *)
event * = 03H;
(* A Pointer Position report *)
pointerpos * = 04H;
(* A timer event *)
timer * = 06H;
(* select button pressed down over a Gadget (address in ieEventAddress) *)
gadgetdown * = 07H;
(* select button released over the same Gadget (address in ieEventAddress) *)
gadgetup * = 08H;
(* some Requester activity has taken place. See Codes REQCLEAR and REQSET *)
requester * = 09H;
(* this is a Menu Number transmission (Menu number is in ieCode) *)
menulist * = 0AH;
(* User has selected the active Window's Close Gadget *)
closewindow * = 0BH;
(* this Window has a new size *)
sizewindow * = 0CH;
(* the Window pointed to by ieEventAddress needs to be refreshed *)
refreshwindow * = 0DH;
(* new preferences are available *)
newprefs * = 0EH;
(* the disk has been removed *)
diskremoved * = 0FH;
(* the disk has been inserted *)
diskinserted * = 10H;
(* the window is about to be been made active *)
activewindow * = 11H;
(* the window is about to be made inactive *)
inactivewindow * = 12H;
(* extended-function pointer position report (V36) *)
newpointerpos * = 13H;
(* Help key report during Menu session (V36) *)
menuhelp * = 14H;
(* the Window has been modified with move, size, zoom, or change (V36) *)
changewindow * = 15H;
(* the last class *)
classMax * = 15H;
(* --- InputEvent.ieSubClass --- *)
(* NewPointerPos *)
(* like PointerPos *)
compatible * = 00H;
(* InputEvent.eventAddress points to PointerPixel) *)
pixel * = 01H;
(* InputEvent.eventAddress points to PointerTablet) *)
tablet * = 02H;
(* InputEvent.eventAddress points to NewTablet *)
newTablet * = 03H;
TYPE
IEDummyPtr * = POINTER TO IEDummy;
IEDummy * = RECORD END;
(* pointed to by InputEvent.eventAddress for classNewPointerPos,
* and subClassPixel.
*
* You specify a screen and pixel coordinates in that screen
* at which you'd like the mouse to be positioned.
* Intuition will try to oblige, but there will be restrictions
* to positioning the pointer over offscreen pixels.
*
* qualRelativeMouse is supported for subClassPixel.
*)
PointerPixelPtr* = POINTER TO PointerPixel;
PointerPixel* = RECORD (IEDummy)
screen* : e.APTR; (* Intuition.ScreenPtr *)
(* pointer to an open screen *)
position* : g.Point; (* pixel coordinates in screen *)
END; (* PointerPixel *)
(* pointed to by InputEvent.eventAddress for classNewPointerPos,
* and subClassTablet.
*
* You specify a range of values and a value within the range
* independently for each of X and Y (the minimum value of
* the ranges is always normalized to 0).
*
* Intuition will position the mouse proportionally within its
* natural mouse position rectangle limits.
*
* qualRelativeMouse is not supported for subClassTablet.
*)
PointerTabletPtr* = POINTER TO PointerTablet;
PointerTablet* = RECORD (IEDummy)
range * : g.Point; (* 0 is min, these are max *)
value * : g.Point; (* between 0 and Range *)
pressure * :INTEGER; (* -128 to 127 (unused, set to 0) *)
END; (* PointerTablet *)
(* The InputEvent.eventAddress of an classNewPointerPos event of subclass
* subClassNewTablet points at a NewTablet structure.
*
*
* qualRelativeMouse is not supported for subClassNewTablet.
*)
NewTabletPtr * = POINTER TO NewTablet;
NewTablet * = RECORD (IEDummy)
(* Pointer to a hook you wish to be called back through, in
* order to handle scaling. You will be provided with the
* width and height you are expected to scale your tablet
* to, perhaps based on some user preferences.
* If NULL, the tablet's specified range will be mapped directly
* to that width and height for you, and you will not be
* called back.
*)
callBack * : u.HookPtr;
(* Post-scaling coordinates and fractional coordinates.
* DO NOT FILL THESE IN AT THE TIME THE EVENT IS WRITTEN!
* Your driver will be called back and provided information
* about the width and height of the area to scale the
* tablet into. It should scale the tablet coordinates
* (perhaps based on some preferences controlling aspect
* ratio, etc.) and place the scaled result into these
* fields. The ient_ScaledX and ient_ScaledY fields are
* in screen-pixel resolution, but the origin ( [0,0]-point )
* is not defined. The ient_ScaledXFraction and
* ient_ScaledYFraction fields represent sub-pixel position
* information, and should be scaled to fill a UWORD fraction.
*)
scaledX *, scaledY * : e.UWORD;
scaledXFraction *, scaledYFraction * : e.UWORD;
(* Current tablet coordinates along each axis: *)
tabletX *, tabletY * : e.ULONG;
(* Tablet range along each axis. For example, if ient_TabletX
* can take values 0-999, ient_RangeX should be 1000.
*)
rangeX *, rangeY * : e.ULONG;
(* Pointer to tag-list of additional tablet attributes.
* See <intuition/intuition.h> for the tag values.
*)
tagList * : u.TagListPtr;
END;
CONST
(* --- InputEvent.ieCode --- *)
(* rawKey *)
upPrefix * = 80H;
keyCodeFirst * = 00H;
keyCodeLast * = 77H;
commCodeFirst * = 78H;
commCodeLast * = 7FH;
(* ANSI *)
c0First * = 00H;
c0Last * = 1FH;
asciiFirst * = 20H;
asciiLast * = 7EH;
asciiDel * = 7FH;
c1First * = 80H;
c1Last * = 9FH;
latin1First * = 0A0H;
latin1Last * = 0FFH;
(* RawMouse *)
lButton * = 68H; (* also uses UpPREFIX *)
rButton * = 69H;
mButton * = 6AH;
noButton * = 0FFH;
(* Event (V36) *)
newActive * = 01H; (* new active input window *)
newSize * = 02H; (* resize of window *)
refresh * = 03H; (* refresh of window *)
(* Requester *)
(* broadcast when the first Requester (not subsequent ones) opens up in *)
(* the Window *)
reqSet * = 01H;
(* broadcast when the last Requester clears out of the Window *)
reqClear * = 00H;
(* --- InputEvent.ieQualifier --- *)
lShift * = 0;
rShift * = 1;
capsLock * = 2;
control * = 3;
lAlt * = 4;
rAlt * = 5;
lCommand * = 6;
rCommand * = 7;
numericPad * = 8;
repeat * = 9;
interrupt * = 10;
multiBroadcast * = 11;
midButton * = 12;
rightButton * = 13;
leftButton * = 14;
relativeMouse * = 15;
(* ----- InputEvent -------------------------------------------------*)
TYPE
InputEventDummyPtr* = POINTER TO InputEventDummy;
InputEventDummy* = RECORD END;
InputEventPtr* = POINTER TO InputEvent;
InputEvent* = RECORD (InputEventDummy)
nextEvent* : InputEventDummyPtr; (* the chronologically next event *)
class * : SHORTINT; (* the input event class *)
subClass * : SHORTINT; (* optional subclass of the class *)
code * : e.UWORD; (* the input event code *)
qualifier* : s.SET16; (* qualifiers in effect for the event*)
x * : INTEGER; (* the pointer position for the event*)
y * : INTEGER;
timeStamp * : t.TimeVal; (* the system tick at the event *)
END; (* InputEvent *)
InputEventAdrPtr* = POINTER TO InputEventAdr;
InputEventAdr* = RECORD (InputEventDummy)
nextEvent* : InputEventDummyPtr; (* the chronologically next event *)
class * : SHORTINT; (* the input event class *)
subClass * : SHORTINT; (* optional subclass of the class *)
code * : e.UWORD; (* the input event code *)
qualifier* : s.SET16; (* qualifiers in effect for the event*)
addr * : IEDummyPtr; (* the event address *)
TimeStamp * : t.TimeVal; (* the system tick at the event *)
END; (* InputEventAdr *)
InputEventPrevPtr* = POINTER TO InputEventPrev;
InputEventPrev* = RECORD (InputEventDummy)
nextEvent* : InputEventDummyPtr; (* the chronologically next event *)
class * : SHORTINT; (* the input event class *)
subClass * : SHORTINT; (* optional subclass of the class *)
code * : e.UWORD; (* the input event code *)
qualifier* : s.SET16; (* qualifiers in effect for the event*)
prev1DownCode * : SHORTINT; (* previous down keys for dead *)
prev1DownQual * : s.SET8; (* key translation: the ieCode *)
prev2DownCode * : SHORTINT; (* & low byte of ieQualifier for *)
prev2DownQual * : s.SET8; (* last & second last down keys *)
timeStamp * : t.TimeVal; (* the system tick at the event *)
END; (* InputEventPrev *)
END InputEvent.